﻿using Microsoft.EntityFrameworkCore;
using System;
using KwaiXiaoDian.Entity.DO;

namespace KwaiXiaoDian.Data
{
    public class KwaiXiaoDianDbContext : DbContext
    {
        public KwaiXiaoDianDbContext(DbContextOptions<KwaiXiaoDianDbContext> options) : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            //var loggerFactory = new LoggerFactory(); 
            //loggerFactory.AddProvider(new EFLoggerProvider()); 
            optionsBuilder.EnableSensitiveDataLogging(true);
            //optionsBuilder.UseLoggerFactory(loggerFactory); 

            //打印日志
            optionsBuilder.LogTo(Console.WriteLine);

            base.OnConfiguring(optionsBuilder);
        }

        public DbSet<TCookie> TCookie { get; set; }
        public DbSet<TUser> TUser { get; set; }
        public DbSet<TGroupLeader> TGroupLeader { get; set; }
        public DbSet<TProduct> TProduct { get; set; }
        public DbSet<TProductExpress> TProductExpress { get; set; }
        public DbSet<TProductShop> TProductShop { get; set; }
        public DbSet<TProductRank> TProductRank { get; set; }
        public DbSet<TChannel> TChannel { get; set; }
        public DbSet<TProductPromote> TProductPromote { get; set; }


    }
}
